package com.jt.provider.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
public class ProviderLogController {

    private static final Logger log = LoggerFactory.getLogger(ProviderLogController.class);

    @GetMapping("/provider/log/doLog01")
    public String doLog01(){
        System.out.println("==doLog01==");
        log.trace("===trace===");
        log.debug("===debug===");
        log.info("===info===");
        log.warn("===warn===");
        log.error("===error===");
        return "log test 01";
    }

    @Value("${logging.level.com.jt: error}")
    private String logLevel;
    @GetMapping("/provider/log/doLog02")
    public String deLog02(){
        log.info("log level is {}",logLevel);
        return "log level is " + logLevel;
    }

}
